package com.hust.hui.quick.tool;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by yihui on 2017/7/15.
 */
public class CheckTool {

    // 邮箱校验正则表达式
    private static Pattern pattern = Pattern.compile("^([a-zA-Z0-9-_\\.])+@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,10})+$");

    /**
     * 判断是否为邮箱格式  xx@xx.xx
     *
     * @param str
     * @return
     */
    public static boolean isEmail(String str) {
        Matcher matcher = pattern.matcher(str);
        return matcher.find();
    }

}
